/**
 * Created by kangli on 2018/3/6.
 */


/*
 添加考试*/
function addTestList(btn){
    var html ='  <div class="g-confirmDiv">' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试开始时间：</p> ' +
        '<div class="form-group fl" style="width: 200px"> ' +
        '<div class="input-group date form_date1 " data-date="" data-date-format="dd MM yyyy" data-link-field="test_date" data-link-format="yyyy-mm-dd"> ' +
        '<input class="form-control" size="16" type="text" value="" readonly=""> ' +
        '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div>' +
        '<input type="hidden" id="" value="test_date"></div></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试结束时间：</p> ' +
        '<div class="form-group fl" style="width: 200px"> ' +
        '<div class="input-group date form_date1 " data-date="" data-date-format="dd MM yyyy" data-link-field="test_date" data-link-format="yyyy-mm-dd"> ' +
        '<input class="form-control" size="16" type="text" value="" readonly=""> ' +
        '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div>' +
        '<input type="hidden" id="" value="test_date"></div></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">报名截止时间：</p> ' +
        '<div class="form-group fl " style="width: 200px"> ' +
        '<div class="input-group date form_date " data-date="" data-date-format="dd MM yyyy" data-link-field="test_date" data-link-format="yyyy-mm-dd"> ' +
        '<input class="form-control" size="16" type="text" value="" readonly=""> ' +
        '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> </div> ' +
        '<input type="hidden" id="" value="test_date"> </div></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试人数：</p> ' +
        '<input type="text" class="form-control fl" style="width: 200px"><span class="units">人</span> </div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试题数：</p> ' +
        '<select class="form-control fl em-select" style="width: 200px"> ' +
        '<option value="1">50</option> ' +
        '<option value="2">100</option> ' +
        '<option value="3">150</option> ' +
        '</select> <span class="units">题</span></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试分数线：</p> <input type="text" class="form-control fl" style="width: 200px"><span class="units">分</span> </div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试时间：</p> <input type="text" class="form-control fl" style="width: 200px"><span class="units">分</span> </div></div>';
    parent.layer.open({
        type: 1,
        area: ['500px', ''],
        title: '新增考试',
        btn: ['确定','取消'],
        shadeClose: true, //点击遮罩关闭
        content: html,
        success: function(layero, index){
            console.log(parent.$('.form_date1').length)
            parent.$('.form_date1').datetimepicker({
                language:  'zh-CN',
                weekStart: 1,
                todayBtn:  1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                minView: 0,
                forceParse: 0,
                format: 'yyyy-mm-dd hh:ii'
            });
        },
        yes: function(index){

        },
        btn2: function(index){
            parent.layer.close(index);
            /*   return false;*/
        }
    });

}
/*
添加考生*/
function addStudent(btn){
    var html ='  <div class="g-confirmDiv">' +
        '<div class="g-confirmlist clearfix"><p class="fl">学号：</p> ' +
        '<input type="text" class="form-control fl" style="width: 200px"></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">考试编号：</p> ' +
        '<select class="form-control fl em-select" style="width: 200px"> ' +
        '<option value="1">1个月</option> ' +
        '<option value="2">3个月</option> ' +
        '<option value="3">6个月</option> ' +
        '<option value="4">12个月</option> ' +
        '</select> </div></div>';
    parent.layer.open({
        type: 1,
        area: ['500px', ''],
        title: '新增考生',
        btn: ['确定','取消'],
        shadeClose: true, //点击遮罩关闭
        content: html,
        success: function(layero, index){

        },
        yes: function(index){

        },
        btn2: function(index){
            parent.layer.close(index);
            /*   return false;*/
        }
    });
}
/*编辑自测设置*/
function editSelfSet(btn){
    var html1 ='  <div class="g-confirmDiv">' +
        '<div class="g-confirmlist clearfix"><p class="fl">自测成绩有效期：</p> ' +
        '<select class="form-control fl em-select" style="width: 200px"> ' +
        '<option value="1">1个月</option> ' +
        '<option value="2">3个月</option> ' +
        '<option value="3">6个月</option> ' +
        '<option value="4">12个月</option> ' +
        '</select> </div>' +
        '<div class="g-confirmlist clearfix"><p class="fl">自测题目：</p> ' +
    '<select class="form-control fl em-select" style="width: 200px"> ' +
    '<option value="1">50</option> ' +
    '<option value="2">100</option> ' +
    '<option value="3">150</option> ' +
    '<option value="4">12个月</option> ' +
    '</select><span class="units">题</span> </div> ' +
         '<div class="g-confirmlist clearfix"><p class="fl">自测通过分数线：</p> ' +
    '<input type="text" class="form-control fl em-searchInput"  style="width: 200px"><span class="units">分</span></div></div>';
    parent.layer.open({
        type: 1,
        area: ['500px', ''],
        title: '编辑自测设置',
        btn: ['确定','取消'],
        shadeClose: true, //点击遮罩关闭
        content: html1,
        success: function(layero, index){

        },
        yes: function(index){

        },
        btn2: function(index){
            parent.layer.close(index);
            /*   return false;*/
        }
    });
}
